﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ylh.BLL;
using System.Data;

public partial class Module_NoteManger_NoteView :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Gvload();
        }

    }

    private void Gvload()
    {
        Ylh.BLL.NoteBLL bll = new NoteBLL(DbConnectionStr);
       Grid1.DataSource= bll.GetList(" [State]=1  ");
       Grid1.DataBind();
    }



    protected void Grid1_RowDataBound(object sender, ExtAspNet.GridRowEventArgs e)
    {
        System.Web.UI.WebControls.LinkButton LinkButton1 = (System.Web.UI.WebControls.LinkButton)Grid1.Rows[e.RowIndex].FindControl("LinkButton1");

        string str = Grid1.DataKeys[e.RowIndex][0].ToString();

        Ylh.BLL.NoteBLL blln = new NoteBLL(DbConnectionStr);

        Ylh.Model.TbNote note = blln.GetModel(Convert.ToInt32(str));

        LinkButton1.Text = note.Summary;

       // LinkButton1.OnClientClick = "window.open ('" + note .FilePath+ "','newwindow','height=600,width=800,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no')";

        //LinkButton1.OnClientClick = Window1.GetShowReference(note.FilePath, "公告详细信息");

        LinkButton1.OnClientClick = Window1.GetShowReference("NoteViewNew.aspx?NoteID=" + str, "公告详细信息");


    }



    protected void BtnRefresh_Click(object sender, EventArgs e)
    {
        Gvload();
    }
}